import Vue from 'vue'
import Router from 'vue-router'
import Login from '../view/Login'
import DeviceList from '../view/DeviceList'
import RealtimeData from '../view/RealtimeData'
import HistoryData from '../view/HistoryData'

Vue.use(Router)

export default new Router({
  routes: [
    {
      path: '/',
      component: DeviceList,
      meta: {
        title: '人员定位-登陆'
      }
    },
    {
      path: '/login',
      name: 'Login',
      component: Login,
      meta: {
        title: '人员定位-登陆'
      }
    },
    {
      path: '/device',
      name: 'DeviceList',
      component: DeviceList,
      meta: {
        title: '人员定位-设备列表'
      }
    },
    {
      path: '/realtime',
      name: 'RealtimeData',
      component: RealtimeData,
      meta: {
        title: '人员定位-实时数据',
        requireAuth: true, // 判断是否需要登录
      }
    },
    {
      path: '/history',
      name: 'HistoryData',
      component: HistoryData,
      meta: {
        title: '人员定位-历史数据',
        requireAuth: true, // 判断是否需要登录
      }
    }
  ]
})
